Skip to content

FromCabal: remove LLVM evil#668

Merged
sternenseemann merged 5 commits intoNixOS:masterfrom
emilazy:push-rwotzqmwxrrq
Sep 9, 2025
Merged

FromCabal: remove LLVM evil#668
sternenseemann merged 5 commits intoNixOS:masterfrom
emilazy:push-rwotzqmwxrrq

Conversation

@emilazy
Copy link
Copy Markdown
Member

@emilazy emilazy commented Sep 8, 2025

No description provided.

@emilazy emilazy marked this pull request as draft September 8, 2025 03:18
Comment thread doc/frequently-asked-questions.rst Outdated
Comment thread cabal2nix/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs Outdated
@emilazy emilazy marked this pull request as ready for review September 8, 2025 17:31
We’re patching out the `-fllvm` in Nixpkgs instead. This was
incorrect, anyway, as the LLVM build tools should not be added to
`libraryPkgconfigDepends`.
emilazy and others added 4 commits September 9, 2025 01:18
Usually, there is no reason to tie use of LLVM libraries to the LLVM
version used by GHC’s LLVM backend as packages should not declare this
as a library dependency.

Also, `libclang` is the correct dependency for Clang used as a
library, rather than the wrapped `clang` tool. (In practice, though,
this doesn’t really help: the packages this changes in Nixpkgs
are already broken because they depend on ancient LLVMs, want the
`llvm-config(1)` tool that is in the `llvm` package, and in one of
the two cases the `Setup.hs` doesn’t even build with modern Cabal.)

To get a consistent result in hackage-packages.nix, we unfortunately
have to add an extra alias for clang-3.8 (which has long been removed)
until LibClang is removed from the package set.
Previously, vte-2.91 was mapped to a pseudo attribute vte_291 which was
special cased in resolveInNixpkgs. This seems not much better than
encoding this knowledge via libNixName directly, so let's simplify the
logic.
These do not appear to have an effect on hackage-packages.nix at all (anymore?).
@sternenseemann
Copy link
Copy Markdown
Member

With the extra cleanup, we now have the following diff:

diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix
index 85eea82315fd..45910e661c6d 100644
--- a/pkgs/development/haskell-modules/hackage-packages.nix
+++ b/pkgs/development/haskell-modules/hackage-packages.nix
@@ -16266,7 +16266,6 @@ self: {
       mkDerivation,
       array,
       base,
-      llvm,
     }:
     mkDerivation {
       pname = "GlomeVec";
@@ -16276,11 +16275,10 @@ self: {
         array
         base
       ];
-      libraryPkgconfigDepends = [ llvm ];
       description = "Simple 3D vector library";
       license = "GPL";
     }
-  ) { inherit (self.llvmPackages) llvm; };
+  ) { };
 
   "GlomeView" = callPackage (
     {
@@ -27647,9 +27645,9 @@ self: {
           base,
           bytestring,
           c2hs,
-          clang,
           filepath,
           hashable,
+          libclang,
           mtl,
           ncurses,
           resourcet,
@@ -27676,7 +27674,7 @@ self: {
             transformers-base
             vector
           ];
-          librarySystemDepends = [ clang ];
+          librarySystemDepends = [ libclang ];
           libraryPkgconfigDepends = [ ncurses ];
           libraryToolDepends = [ c2hs ];
           description = "Haskell bindings for libclang (a C++ parsing library)";
@@ -27686,7 +27684,7 @@ self: {
         }
       )
       {
-        inherit (self.llvmPackages) clang;
+        inherit (pkgs) libclang;
         inherit (pkgs) ncurses;
       };
 
@@ -141306,11 +141304,11 @@ self: {
       base,
       bytestring,
       Cabal,
-      clang,
       containers,
       contravariant,
       inline-c,
       lens,
+      libclang,
       microlens,
       microlens-contra,
       process,
@@ -141344,7 +141342,7 @@ self: {
         template-haskell
         vector
       ];
-      librarySystemDepends = [ clang ];
+      librarySystemDepends = [ libclang ];
       testHaskellDepends = [
         base
         bytestring
@@ -141355,7 +141353,7 @@ self: {
       hydraPlatforms = lib.platforms.none;
       broken = true;
     }
-  ) { inherit (self.llvmPackages) clang; };
+  ) { inherit (pkgs) libclang; };
 
   "clanki" = callPackage (
     {
@@ -267231,7 +267229,7 @@ self: {
       haskell-gi-overloading,
       text,
       transformers,
-      vte_291,
+      vte,
     }:
     mkDerivation {
       pname = "gi-vte";
@@ -267270,12 +267268,12 @@ self: {
         text
         transformers
       ];
-      libraryPkgconfigDepends = [ vte_291 ];
+      libraryPkgconfigDepends = [ vte ];
       description = "Vte bindings";
       license = lib.licenses.lgpl21Only;
       badPlatforms = lib.platforms.darwin;
     }
-  ) { vte_291 = pkgs.vte; };
+  ) { inherit (pkgs) vte; };
 
   "gi-webkit" = callPackage (
     {
@@ -664371,7 +664369,7 @@ self: {
           text,
           transformers,
           unordered-containers,
-          vte_291,
+          vte,
           xml-conduit,
           xml-html-qq,
           yaml,
@@ -664421,7 +664419,7 @@ self: {
           libraryPkgconfigDepends = [
             gtk3
             pcre2
-            vte_291
+            vte
           ];
           executableHaskellDepends = [ base ];
           testHaskellDepends = [
@@ -664441,7 +664439,7 @@ self: {
       {
         inherit (pkgs) gtk3;
         inherit (pkgs) pcre2;
-        vte_291 = pkgs.vte;
+        inherit (pkgs) vte;
       };
 
   "termplot" = callPackage (

@emilazy
Copy link
Copy Markdown
Member Author

emilazy commented Sep 8, 2025

LGTM. Do you want me to regenerate the diff in NixOS/nixpkgs#441101, or just let it get washed out by the next cabal2nix run?

@sternenseemann
Copy link
Copy Markdown
Member

I would merge NixOS/nixpkgs#441324 and then put a similar update onto your PR, though I can take care of that for you.

@emilazy
Copy link
Copy Markdown
Member Author

emilazy commented Sep 9, 2025

Sounds good.

@sternenseemann sternenseemann merged commit 987474e into NixOS:master Sep 9, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants